//
//  ABCRepeatClick.m
//  ABCRepeateClick
//
//  Created by luoshizhen on 2024/7/26.
//

#import "ABCRepeatClickManager.h"
#import "UIControl+ABCRepeateClick.h"
@implementation ABCRepeatClickManager
static ABCRepeatClickManager *_instance = nil;
+ (instancetype)shareInstance
{
    static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
         _instance = [[ABCRepeatClickManager alloc] init];
         _instance.defualtRepeateTime = 0.5;
     });
     return _instance;
 }
- (void)setDefualtRepeateTime:(NSTimeInterval)defualtRepeateTime{
    _defualtRepeateTime = defualtRepeateTime;
}

- (BOOL)openUIControlPreventRepeatClick
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
    if ([UIControl respondsToSelector:@selector(openPreventRepeatClick)]) {
        [UIControl performSelector:@selector(openPreventRepeatClick)];
        return true;
    }
#pragma clang diagnostic pop
    NSLog(@"设置重复点击失败");
    return false;
}
@end
